/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: Universidad de La Frontera
 * License Type: Academic
 */
package orm;

import java.util.List;
import org.hibernate.criterion.DetachedCriteria;
import org.orm.PersistentSession;
import org.orm.criteria.*;

public class ConsumoDetachedCriteria extends AbstractORMDetachedCriteria {
	public final IntegerExpression consumo_ID;
	public final StringExpression lectura;
	public final IntegerExpression monto;
	public final StringExpression fecha_emision;
	public final StringExpression fecha_termino;
	
	public ConsumoDetachedCriteria() {
		super(orm.Consumo.class, orm.ConsumoCriteria.class);
		consumo_ID = new IntegerExpression("consumo_ID", this.getDetachedCriteria());
		lectura = new StringExpression("lectura", this.getDetachedCriteria());
		monto = new IntegerExpression("monto", this.getDetachedCriteria());
		fecha_emision = new StringExpression("fecha_emision", this.getDetachedCriteria());
		fecha_termino = new StringExpression("fecha_termino", this.getDetachedCriteria());
	}
	
	public ConsumoDetachedCriteria(DetachedCriteria aDetachedCriteria) {
		super(aDetachedCriteria, orm.ConsumoCriteria.class);
		consumo_ID = new IntegerExpression("consumo_ID", this.getDetachedCriteria());
		lectura = new StringExpression("lectura", this.getDetachedCriteria());
		monto = new IntegerExpression("monto", this.getDetachedCriteria());
		fecha_emision = new StringExpression("fecha_emision", this.getDetachedCriteria());
		fecha_termino = new StringExpression("fecha_termino", this.getDetachedCriteria());
	}
	
	public CuentaDetachedCriteria createCuentacuentaCriteria() {
		return new CuentaDetachedCriteria(createCriteria("cuentacuenta"));
	}
	
	public TipoConsumoDetachedCriteria createTipoConsumotipoconCriteria() {
		return new TipoConsumoDetachedCriteria(createCriteria("tipoConsumotipocon"));
	}
	
	public Consumo uniqueConsumo(PersistentSession session) {
		return (Consumo) super.createExecutableCriteria(session).uniqueResult();
	}
	
	public Consumo[] listConsumo(PersistentSession session) {
		List list = super.createExecutableCriteria(session).list();
		return (Consumo[]) list.toArray(new Consumo[list.size()]);
	}
}

